//
//  SettingViewController.m
//  MyvIEW
//
//  Created by Macbook on 28/7/17.
//  Copyright © 2017年 huyu. All rights reserved.
//

#import "SettingViewController.h"
#import "ForgetPasswordViewController.h"
@interface SettingViewController ()

@end

@implementation SettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIButton *backbutton = [[UIButton alloc]initWithFrame:CGRectMake(10, 20, 15, 25)];
    [backbutton setBackgroundImage:[UIImage imageNamed:@"香草园地-发布信息_03@2x"] forState:UIControlStateNormal];
    [backbutton addTarget:self action:@selector(goBacktoUp) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithCustomView:backbutton];
    self.navigationItem.leftBarButtonItem = backItem;

}
-(void)goBacktoUp{
    [self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)PassRestBut:(id)sender {
    ForgetPasswordViewController* PassOne = [[ForgetPasswordViewController alloc]init];
    PassOne.status = @"2";
    [self.navigationController pushViewController:PassOne animated:YES];
}
- (IBAction)LoginOutBut:(id)sender {
    
    
//    [[EaseMob sharedInstance].chatManager asyncLogoffWithUnbindDeviceToken:YES completion:^(NSDictionary *info, EMError *error) {
//        if (!error && info) {
//            NSLog(@"环信退出成功");
//        }
//    } onQueue:nil];
//    
//    [[LoginManager Instance] showLoginView];
    EMError *error = [[EMClient sharedClient] logout:YES];
    if (!error) {
        NSLog(@"退出成功");
    }
    [USERDEFAULT setBool:NO forKey:@"isLogin"];
    [UIAppDelegate loginView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
